package com.yipinhouse.signing.app.appImpl;

import cn.hutool.core.bean.BeanUtil;
import com.yipinhouse.common.result.Result;
import com.yipinhouse.signing.client.SigningManageClient;
import com.yipinhouse.signing.client.param.DoSigningParam;
import com.yipinhouse.signing.service.SigningService;
import com.yipinhouse.signing.service.param.DoSigningServiceParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/signing")
public class SigningManageApiImpl implements SigningManageClient {

    @Resource
    private SigningService service;
    @Override
    public Result doSigning(DoSigningParam param) {
        log.info("签约：参数：{}",param);
        DoSigningServiceParam tempParam = BeanUtil.toBean(param, DoSigningServiceParam.class);
        service.doSigning(tempParam);
        return Result.getInstance().setMsg("签约成功！");
    }
}
